<template>
	<view>
		
		<!-- 选择栏 -->
		<view class="choose-tab flex relative" :style="[{top:0 + 'px'}]">
			<view :class="['tab-item flex-sub',checked == index ? 'active':'']" v-for="(item,index) in tabbar"
				:key="index" @click="chooseTab(index)">
				{{item.name}}
			</view>
		</view>
		
		<view style="width:750rpx;height:116rpx;"></view>
		
		<!-- 全部列表 -->
		<view class="item flex" v-for="(item,index) in 6" :key="index"> 
			
			<view class="item1">
				<view class="text1">
					积分商城兑换50积分
				</view>
				<view class="text2">
					2017-08-15 10:25:42
				</view>
				
			</view>
			<view class="item2">
				+88
			</view>
			
		</view>
		
		

	</view>
</template>

<script>
	export default {
		data() {
			return {
				
				checked: 0, //选中下标
				tabbar: [{
						id: 1,
						name: '全部'
					},
					{
						id: 2,
						name: '获取'
					},
					{
						id: 3,
						name: '消耗'
					}
				]

			}
		},
		onLoad() {

		},
		methods: {
			chooseTab(index) {
				this.checked = index;
				this.swiperCurrentIndex = index;
				console.log(this.checked, '===checked')
			},
			

		}
	}
</script>

<style lang="scss">
	page{
		background-color: #eee;
	}
	// 列表内容
	.item{
		width:750rpx;
		height:120rpx;
		padding: 0 32rpx;
		background-color: white;
		margin-bottom: 8rpx;
		.item1{
			width:600rpx;
			height:120rpx;
			padding:10rpx 0;
			.text1{
				font-size: 32rpx;
				line-height: 50rpx;
			}
			.text2{
				font-size: 26rpx;
				line-height: 50rpx;
				color:#c1c6ca;
			}
		}
		.item2{
			width:86rpx;
			height:120rpx;
			line-height: 120rpx;
			text-align: center;
			font-size: 36rpx;
		}
	}
	.choose-tab {
		width: 750rpx;
		height: 116rpx;
		background-color: white;
		border-bottom: 2rpx solid #eee;
		z-index: 9999;
		line-height: 116rpx;
		text-align: center;
		color: #999999;
		position: fixed;
		left: 0;
	
		.top-img {
			position: absolute;
			top: 0;
			left: 0;
		}
	
		.tab-item {
			position: relative;
			font-size: 28rpx;
			font-family: PingFang SC;
			font-weight: bold;
			line-height: 116rpx;
			color: #999999;
		}
	
		.active {
			font-size: 28rpx;
			font-family: PingFang SC;
			font-weight: bold;
			line-height: 116rpx;
			color: #DC2D20;
		}
	}

	
	
</style>
